package com.vcms.view.simulation.uicomponent.listener;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

/**
 * Title:        VMCS
 * Description:
 * Copyright:    Copyright (c) 2001
 * Company:      ISS
 * @author Pang Pingli
 * @version 1.0
 */
import java.awt.*;

import com.vcms.view.simulation.uifactory.EventArgs;
import com.vcms.view.simulation.uifactory.VMCSEventHandler;

import com.vcms.controller.machine.AccessManager;

public class PasswordListener implements ActionListener, VMCSEventHandler {

	AccessManager actrl;

	public PasswordListener(AccessManager ac) {
		actrl = ac;
	}

	public void actionPerformed(ActionEvent e) {
		/** @todo: Implement this java.awt.event.ActionListener method */
		TextField text;

		String pswd;

		text = (TextField) e.getSource();
		pswd = text.getText();
		actrl.processPassword(pswd);
	}
	
	public void vmcsActionPerformed(Object eventSource, EventArgs args) {
		ActionEvent event = new ActionEvent(null, 0, null);
		this.actionPerformed(event);
	}
}